package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-05
 * Time: 16:30
 */
public class Test {
    public static void main(String[] args) {
        new AnonClass(){

        }.test();




        new AnonClass(){
            @Override
            public void test() {
                //super.test();
                System.out.println("heihei");
            }
        }.test();//其实就是重写




        A1 a=new A1(){
        public void test(){
                System.out.println("hihi");
            }
        };
        a.test();
    }





    public static void main2(String[] args) {
        RealClass realclass=new RealClass();
        RealClass.InnerRealClass innerrealclass=realclass.new InnerRealClass();
        innerrealclass.test();

    }




    public static void main1(String[] args) {
        A.B inner=new A.B();
        inner.test();
    }
}
